home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / DatabaseMetaData.java < prev    next >
Text File  |  1998-09-22  |  74KB  |  2,018 lines

  1. /*
  2.  * @(#)DatabaseMetaData.java    1.9 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15.  
  16. package java.sql;
  17.  
  18. /**
  19.  * This class provides information about the database as a whole.
  20.  *
  21.  * <P>Many of the methods here return lists of information in ResultSets.
  22.  * You can use the normal ResultSet methods such as getString and getInt 
  23.  * to retrieve the data from these ResultSets.  If a given form of
  24.  * metadata is not available, these methods should throw a SQLException.
  25.  *
  26.  * <P>Some of these methods take arguments that are String patterns.  These
  27.  * arguments all have names such as fooPattern.  Within a pattern String, "%"
  28.  * means match any substring of 0 or more characters, and "_" means match
  29.  * any one character. Only metadata entries matching the search pattern 
  30.  * are returned. If a search pattern argument is set to a null ref, it means 
  31.  * that argument's criteria should be dropped from the search.
  32.  * 
  33.  * <P>A SQLException will be thrown if a driver does not support a meta
  34.  * data method.  In the case of methods that return a ResultSet,
  35.  * either a ResultSet (which may be empty) is returned or a
  36.  * SQLException is thrown.
  37.  */
  38. public interface DatabaseMetaData {
  39.  
  40.     //----------------------------------------------------------------------
  41.     // First, a variety of minor information about the target database.
  42.  
  43.     /**
  44.      * Can all the procedures returned by getProcedures be called by the
  45.      * current user?
  46.      *
  47.      * @return true if so
  48.      * @exception SQLException if a database-access error occurs.
  49.      */
  50.     boolean allProceduresAreCallable() throws SQLException;
  51.  
  52.     /**
  53.      * Can all the tables returned by getTable be SELECTed by the
  54.      * current user?
  55.      *
  56.      * @return true if so 
  57.      * @exception SQLException if a database-access error occurs.
  58.      */
  59.     boolean allTablesAreSelectable() throws SQLException;
  60.  
  61.     /**
  62.      * What's the url for this database?
  63.      *
  64.      * @return the url or null if it can't be generated
  65.      * @exception SQLException if a database-access error occurs.
  66.      */
  67.     String getURL() throws SQLException;
  68.  
  69.     /**
  70.      * What's our user name as known to the database?
  71.      *
  72.      * @return our database user name
  73.      * @exception SQLException if a database-access error occurs.
  74.      */
  75.     String getUserName() throws SQLException;
  76.  
  77.     /**
  78.      * Is the database in read-only mode?
  79.      *
  80.      * @return true if so
  81.      * @exception SQLException if a database-access error occurs.
  82.      */
  83.     boolean isReadOnly() throws SQLException;
  84.  
  85.     /**
  86.      * Are NULL values sorted high?
  87.      *
  88.      * @return true if so
  89.      * @exception SQLException if a database-access error occurs.
  90.      */
  91.     boolean nullsAreSortedHigh() throws SQLException;
  92.  
  93.     /**
  94.      * Are NULL values sorted low?
  95.      *
  96.      * @return true if so
  97.      * @exception SQLException if a database-access error occurs.
  98.      */
  99.     boolean nullsAreSortedLow() throws SQLException;
  100.  
  101.     /**
  102.      * Are NULL values sorted at the start regardless of sort order?
  103.      *
  104.      * @return true if so 
  105.      * @exception SQLException if a database-access error occurs.
  106.      */
  107.     boolean nullsAreSortedAtStart() throws SQLException;
  108.  
  109.     /**
  110.      * Are NULL values sorted at the end regardless of sort order?
  111.      *
  112.      * @return true if so
  113.      * @exception SQLException if a database-access error occurs.
  114.      */
  115.     boolean nullsAreSortedAtEnd() throws SQLException;
  116.  
  117.     /**
  118.      * What's the name of this database product?
  119.      *
  120.      * @return database product name
  121.      * @exception SQLException if a database-access error occurs.
  122.      */
  123.     String getDatabaseProductName() throws SQLException;
  124.  
  125.     /**
  126.      * What's the version of this database product?
  127.      *
  128.      * @return database version
  129.      * @exception SQLException if a database-access error occurs.
  130.      */
  131.     String getDatabaseProductVersion() throws SQLException;
  132.  
  133.     /**
  134.      * What's the name of this JDBC driver?
  135.      *
  136.      * @return JDBC driver name
  137.      * @exception SQLException if a database-access error occurs.
  138.      */
  139.     String getDriverName() throws SQLException;
  140.  
  141.     /**
  142.      * What's the version of this JDBC driver?
  143.      *
  144.      * @return JDBC driver version
  145.      * @exception SQLException if a database-access error occurs.
  146.      */
  147.     String getDriverVersion() throws SQLException;
  148.  
  149.     /**
  150.      * What's this JDBC driver's major version number?
  151.      *
  152.      * @return JDBC driver major version
  153.      */
  154.     int getDriverMajorVersion();
  155.  
  156.     /**
  157.      * What's this JDBC driver's minor version number?
  158.      *
  159.      * @return JDBC driver minor version number
  160.      */
  161.     int getDriverMinorVersion();
  162.  
  163.     /**
  164.      * Does the database store tables in a local file?
  165.      *
  166.      * @return true if so
  167.      * @exception SQLException if a database-access error occurs.
  168.      */
  169.     boolean usesLocalFiles() throws SQLException;
  170.  
  171.     /**
  172.      * Does the database use a file for each table?
  173.      *
  174.      * @return true if the database uses a local file for each table
  175.      * @exception SQLException if a database-access error occurs.
  176.      */
  177.     boolean usesLocalFilePerTable() throws SQLException;
  178.  
  179.     /**
  180.      * Does the database treat mixed case unquoted SQL identifiers as
  181.      * case sensitive and as a result store them in mixed case?
  182.      *
  183.      * A JDBC-Compliant driver will always return false.
  184.      *
  185.      * @return true if so 
  186.      * @exception SQLException if a database-access error occurs.
  187.      */
  188.     boolean supportsMixedCaseIdentifiers() throws SQLException;
  189.  
  190.     /**
  191.      * Does the database treat mixed case unquoted SQL identifiers as
  192.      * case insensitive and store them in upper case?
  193.      *
  194.      * @return true if so 
  195.      * @exception SQLException if a database-access error occurs.
  196.      */
  197.     boolean storesUpperCaseIdentifiers() throws SQLException;
  198.  
  199.     /**
  200.      * Does the database treat mixed case unquoted SQL identifiers as
  201.      * case insensitive and store them in lower case?
  202.      *
  203.      * @return true if so 
  204.      * @exception SQLException if a database-access error occurs.
  205.      */
  206.     boolean storesLowerCaseIdentifiers() throws SQLException;
  207.  
  208.     /**
  209.      * Does the database treat mixed case unquoted SQL identifiers as
  210.      * case insensitive and store them in mixed case?
  211.      *
  212.      * @return true if so 
  213.      * @exception SQLException if a database-access error occurs.
  214.      */
  215.     boolean storesMixedCaseIdentifiers() throws SQLException;
  216.  
  217.     /**
  218.      * Does the database treat mixed case quoted SQL identifiers as
  219.      * case sensitive and as a result store them in mixed case?
  220.      *
  221.      * A JDBC-Compliant driver will always return true.
  222.      *
  223.      * @return true if so
  224.      * @exception SQLException if a database-access error occurs.
  225.      */
  226.     boolean supportsMixedCaseQuotedIdentifiers() throws SQLException;
  227.  
  228.     /**
  229.      * Does the database treat mixed case quoted SQL identifiers as
  230.      * case insensitive and store them in upper case?
  231.      *
  232.      * @return true if so 
  233.      * @exception SQLException if a database-access error occurs.
  234.      */
  235.     boolean storesUpperCaseQuotedIdentifiers() throws SQLException;
  236.  
  237.     /**
  238.      * Does the database treat mixed case quoted SQL identifiers as
  239.      * case insensitive and store them in lower case?
  240.      *
  241.      * @return true if so 
  242.      * @exception SQLException if a database-access error occurs.
  243.      */
  244.     boolean storesLowerCaseQuotedIdentifiers() throws SQLException;
  245.  
  246.     /**
  247.      * Does the database treat mixed case quoted SQL identifiers as
  248.      * case insensitive and store them in mixed case?
  249.      *
  250.      * @return true if so 
  251.      * @exception SQLException if a database-access error occurs.
  252.      */
  253.     boolean storesMixedCaseQuotedIdentifiers() throws SQLException;
  254.  
  255.     /**
  256.      * What's the string used to quote SQL identifiers?
  257.      * This returns a space " " if identifier quoting isn't supported.
  258.      *
  259.      * A JDBC-Compliant driver always uses a double quote character.
  260.      *
  261.      * @return the quoting string
  262.      * @exception SQLException if a database-access error occurs.
  263.      */
  264.     String getIdentifierQuoteString() throws SQLException;
  265.  
  266.     /**
  267.      * Get a comma separated list of all a database's SQL keywords
  268.      * that are NOT also SQL92 keywords.
  269.      *
  270.      * @return the list 
  271.      * @exception SQLException if a database-access error occurs.
  272.      */
  273.     String getSQLKeywords() throws SQLException;
  274.  
  275.     /**
  276.      * Get a comma separated list of math functions.
  277.      *
  278.      * @return the list
  279.      * @exception SQLException if a database-access error occurs.
  280.      */
  281.     String getNumericFunctions() throws SQLException;
  282.  
  283.     /**
  284.      * Get a comma separated list of string functions.
  285.      *
  286.      * @return the list
  287.      * @exception SQLException if a database-access error occurs.
  288.      */
  289.     String getStringFunctions() throws SQLException;
  290.  
  291.     /**
  292.      * Get a comma separated list of system functions.
  293.      *
  294.      * @return the list
  295.      * @exception SQLException if a database-access error occurs.
  296.      */
  297.     String getSystemFunctions() throws SQLException;
  298.  
  299.     /**
  300.      * Get a comma separated list of time and date functions.
  301.      *
  302.      * @return the list
  303.      * @exception SQLException if a database-access error occurs.
  304.      */
  305.     String getTimeDateFunctions() throws SQLException;
  306.  
  307.     /**
  308.      * This is the string that can be used to escape '_' or '%' in
  309.      * the string pattern style catalog search parameters.
  310.      *
  311.      * <P>The '_' character represents any single character.
  312.      * <P>The '%' character represents any sequence of zero or 
  313.      * more characters.
  314.      *
  315.      * @return the string used to escape wildcard characters
  316.      * @exception SQLException if a database-access error occurs.
  317.      */
  318.     String getSearchStringEscape() throws SQLException;
  319.  
  320.     /**
  321.      * Get all the "extra" characters that can be used in unquoted
  322.      * identifier names (those beyond a-z, A-Z, 0-9 and _).
  323.      *
  324.      * @return the string containing the extra characters 
  325.      * @exception SQLException if a database-access error occurs.
  326.      */
  327.     String getExtraNameCharacters() throws SQLException;
  328.  
  329.     //--------------------------------------------------------------------
  330.     // Functions describing which features are supported.
  331.  
  332.     /**
  333.      * Is "ALTER TABLE" with add column supported?
  334.      *
  335.      * @return true if so
  336.      * @exception SQLException if a database-access error occurs.
  337.      */
  338.     boolean supportsAlterTableWithAddColumn() throws SQLException;
  339.  
  340.     /**
  341.      * Is "ALTER TABLE" with drop column supported?
  342.      *
  343.      * @return true if so
  344.      * @exception SQLException if a database-access error occurs.
  345.      */
  346.     boolean supportsAlterTableWithDropColumn() throws SQLException;
  347.  
  348.     /**
  349.      * Is column aliasing supported? 
  350.      *
  351.      * <P>If so, the SQL AS clause can be used to provide names for
  352.      * computed columns or to provide alias names for columns as
  353.      * required.
  354.      *
  355.      * A JDBC-Compliant driver always returns true.
  356.      *
  357.      * @return true if so 
  358.      * @exception SQLException if a database-access error occurs.
  359.      */
  360.     boolean supportsColumnAliasing() throws SQLException;
  361.  
  362.     /**
  363.      * Are concatenations between NULL and non-NULL values NULL?
  364.      *
  365.      * A JDBC-Compliant driver always returns true.
  366.      *
  367.      * @return true if so
  368.      * @exception SQLException if a database-access error occurs.
  369.      */
  370.     boolean nullPlusNonNullIsNull() throws SQLException;
  371.  
  372.     /**
  373.      * Is the CONVERT function between SQL types supported?
  374.      *
  375.      * @return true if so
  376.      * @exception SQLException if a database-access error occurs.
  377.      */
  378.     boolean supportsConvert() throws SQLException;
  379.  
  380.     /**
  381.      * Is CONVERT between the given SQL types supported?
  382.      *
  383.      * @param fromType the type to convert from
  384.      * @param toType the type to convert to     
  385.      * @return true if so
  386.      * @exception SQLException if a database-access error occurs.
  387.      * @see Types
  388.      */
  389.     boolean supportsConvert(int fromType, int toType) throws SQLException;
  390.  
  391.     /**
  392.      * Are table correlation names supported?
  393.      *
  394.      * A JDBC-Compliant driver always returns true.
  395.      *
  396.      * @return true if so
  397.      * @exception SQLException if a database-access error occurs.
  398.      */
  399.     boolean supportsTableCorrelationNames() throws SQLException;
  400.  
  401.     /**
  402.      * If table correlation names are supported, are they restricted
  403.      * to be different from the names of the tables?
  404.      *
  405.      * @return true if so 
  406.      * @exception SQLException if a database-access error occurs.
  407.      */
  408.     boolean supportsDifferentTableCorrelationNames() throws SQLException;
  409.  
  410.     /**
  411.      * Are expressions in "ORDER BY" lists supported?
  412.      *
  413.      * @return true if so
  414.      * @exception SQLException if a database-access error occurs.
  415.      */
  416.     boolean supportsExpressionsInOrderBy() throws SQLException;
  417.  
  418.     /**
  419.      * Can an "ORDER BY" clause use columns not in the SELECT?
  420.      *
  421.      * @return true if so
  422.      * @exception SQLException if a database-access error occurs.
  423.      */
  424.     boolean supportsOrderByUnrelated() throws SQLException;
  425.  
  426.     /**
  427.      * Is some form of "GROUP BY" clause supported?
  428.      *
  429.      * @return true if so
  430.      * @exception SQLException if a database-access error occurs.
  431.      */
  432.     boolean supportsGroupBy() throws SQLException;
  433.  
  434.     /**
  435.      * Can a "GROUP BY" clause use columns not in the SELECT?
  436.      *
  437.      * @return true if so
  438.      * @exception SQLException if a database-access error occurs.
  439.      */
  440.     boolean supportsGroupByUnrelated() throws SQLException;
  441.  
  442.     /**
  443.      * Can a "GROUP BY" clause add columns not in the SELECT
  444.      * provided it specifies all the columns in the SELECT?
  445.      *
  446.      * @return true if so
  447.      * @exception SQLException if a database-access error occurs.
  448.      */
  449.     boolean supportsGroupByBeyondSelect() throws SQLException;
  450.  
  451.     /**
  452.      * Is the escape character in "LIKE" clauses supported?
  453.      *
  454.      * A JDBC-Compliant driver always returns true.
  455.      *
  456.      * @return true if so
  457.      * @exception SQLException if a database-access error occurs.
  458.      */
  459.     boolean supportsLikeEscapeClause() throws SQLException;
  460.  
  461.     /**
  462.      * Are multiple ResultSets from a single execute supported?
  463.      *
  464.      * @return true if so
  465.      * @exception SQLException if a database-access error occurs.
  466.      */
  467.     boolean supportsMultipleResultSets() throws SQLException;
  468.  
  469.     /**
  470.      * Can we have multiple transactions open at once (on different
  471.      * connections)?
  472.      *
  473.      * @return true if so
  474.      * @exception SQLException if a database-access error occurs.
  475.      */
  476.     boolean supportsMultipleTransactions() throws SQLException;
  477.  
  478.     /**
  479.      * Can columns be defined as non-nullable?
  480.      *
  481.      * A JDBC-Compliant driver always returns true.
  482.      *
  483.      * @return true if so
  484.      * @exception SQLException if a database-access error occurs.
  485.      */
  486.     boolean supportsNonNullableColumns() throws SQLException;
  487.  
  488.     /**
  489.      * Is the ODBC Minimum SQL grammar supported?
  490.      *
  491.      * All JDBC-Compliant drivers must return true.
  492.      *
  493.      * @return true if so
  494.      * @exception SQLException if a database-access error occurs.
  495.      */
  496.     boolean supportsMinimumSQLGrammar() throws SQLException;
  497.  
  498.     /**
  499.      * Is the ODBC Core SQL grammar supported?
  500.      *
  501.      * @return true if so
  502.      * @exception SQLException if a database-access error occurs.
  503.      */
  504.     boolean supportsCoreSQLGrammar() throws SQLException;
  505.  
  506.     /**
  507.      * Is the ODBC Extended SQL grammar supported?
  508.      *
  509.      * @return true if so
  510.      * @exception SQLException if a database-access error occurs.
  511.      */
  512.     boolean supportsExtendedSQLGrammar() throws SQLException;
  513.  
  514.     /**
  515.      * Is the ANSI92 entry level SQL grammar supported?
  516.      *
  517.      * All JDBC-Compliant drivers must return true.
  518.      *
  519.      * @return true if so
  520.      * @exception SQLException if a database-access error occurs.
  521.      */
  522.     boolean supportsANSI92EntryLevelSQL() throws SQLException;
  523.  
  524.     /**
  525.      * Is the ANSI92 intermediate SQL grammar supported?
  526.      *
  527.      * @return true if so
  528.      * @exception SQLException if a database-access error occurs.
  529.      */
  530.     boolean supportsANSI92IntermediateSQL() throws SQLException;
  531.  
  532.     /**
  533.      * Is the ANSI92 full SQL grammar supported?
  534.      *
  535.      * @return true if so
  536.      * @exception SQLException if a database-access error occurs.
  537.      */
  538.     boolean supportsANSI92FullSQL() throws SQLException;
  539.  
  540.     /**
  541.      * Is the SQL Integrity Enhancement Facility supported?
  542.      *
  543.      * @return true if so
  544.      * @exception SQLException if a database-access error occurs.
  545.      */
  546.     boolean supportsIntegrityEnhancementFacility() throws SQLException;
  547.  
  548.     /**
  549.      * Is some form of outer join supported?
  550.      *
  551.      * @return true if so
  552.      * @exception SQLException if a database-access error occurs.
  553.      */
  554.     boolean supportsOuterJoins() throws SQLException;
  555.  
  556.     /**
  557.      * Are full nested outer joins supported?
  558.      *
  559.      * @return true if so
  560.      * @exception SQLException if a database-access error occurs.
  561.      */
  562.     boolean supportsFullOuterJoins() throws SQLException;
  563.  
  564.     /**
  565.      * Is there limited support for outer joins?  (This will be true
  566.      * if supportFullOuterJoins is true.)
  567.      *
  568.      * @return true if so
  569.      * @exception SQLException if a database-access error occurs.
  570.      */
  571.     boolean supportsLimitedOuterJoins() throws SQLException;
  572.  
  573.     /**
  574.      * What's the database vendor's preferred term for "schema"?
  575.      *
  576.      * @return the vendor term
  577.      * @exception SQLException if a database-access error occurs.
  578.      */
  579.     String getSchemaTerm() throws SQLException;
  580.  
  581.     /**
  582.      * What's the database vendor's preferred term for "procedure"?
  583.      *
  584.      * @return the vendor term
  585.      * @exception SQLException if a database-access error occurs.
  586.      */
  587.     String getProcedureTerm() throws SQLException;
  588.  
  589.     /**
  590.      * What's the database vendor's preferred term for "catalog"?
  591.      *
  592.      * @return the vendor term
  593.      * @exception SQLException if a database-access error occurs.
  594.      */
  595.     String getCatalogTerm() throws SQLException;
  596.  
  597.     /**
  598.      * Does a catalog appear at the start of a qualified table name?
  599.      * (Otherwise it appears at the end)
  600.      *
  601.      * @return true if it appears at the start 
  602.      * @exception SQLException if a database-access error occurs.
  603.      */
  604.     boolean isCatalogAtStart() throws SQLException;
  605.  
  606.     /**
  607.      * What's the separator between catalog and table name?
  608.      *
  609.      * @return the separator string
  610.      * @exception SQLException if a database-access error occurs.
  611.      */
  612.     String getCatalogSeparator() throws SQLException;
  613.  
  614.     /**
  615.      * Can a schema name be used in a data manipulation statement?
  616.      *
  617.      * @return true if so
  618.      * @exception SQLException if a database-access error occurs.
  619.      */
  620.     boolean supportsSchemasInDataManipulation() throws SQLException;
  621.  
  622.     /**
  623.      * Can a schema name be used in a procedure call statement?
  624.      *
  625.      * @return true if so
  626.      * @exception SQLException if a database-access error occurs.
  627.      */
  628.     boolean supportsSchemasInProcedureCalls() throws SQLException;
  629.  
  630.     /**
  631.      * Can a schema name be used in a table definition statement?
  632.      *
  633.      * @return true if so
  634.      * @exception SQLException if a database-access error occurs.
  635.      */
  636.     boolean supportsSchemasInTableDefinitions() throws SQLException;
  637.  
  638.     /**
  639.      * Can a schema name be used in an index definition statement?
  640.      *
  641.      * @return true if so
  642.      * @exception SQLException if a database-access error occurs.
  643.      */
  644.     boolean supportsSchemasInIndexDefinitions() throws SQLException;
  645.  
  646.     /**
  647.      * Can a schema name be used in a privilege definition statement?
  648.      *
  649.      * @return true if so
  650.      * @exception SQLException if a database-access error occurs.
  651.      */
  652.     boolean supportsSchemasInPrivilegeDefinitions() throws SQLException;
  653.  
  654.     /**
  655.      * Can a catalog name be used in a data manipulation statement?
  656.      *
  657.      * @return true if so
  658.      * @exception SQLException if a database-access error occurs.
  659.      */
  660.     boolean supportsCatalogsInDataManipulation() throws SQLException;
  661.  
  662.     /**
  663.      * Can a catalog name be used in a procedure call statement?
  664.      *
  665.      * @return true if so
  666.      * @exception SQLException if a database-access error occurs.
  667.      */
  668.     boolean supportsCatalogsInProcedureCalls() throws SQLException;
  669.  
  670.     /**
  671.      * Can a catalog name be used in a table definition statement?
  672.      *
  673.      * @return true if so
  674.      * @exception SQLException if a database-access error occurs.
  675.      */
  676.     boolean supportsCatalogsInTableDefinitions() throws SQLException;
  677.  
  678.     /**
  679.      * Can a catalog name be used in an index definition statement?
  680.      *
  681.      * @return true if so
  682.      * @exception SQLException if a database-access error occurs.
  683.      */
  684.     boolean supportsCatalogsInIndexDefinitions() throws SQLException;
  685.  
  686.     /**
  687.      * Can a catalog name be used in a privilege definition statement?
  688.      *
  689.      * @return true if so
  690.      * @exception SQLException if a database-access error occurs.
  691.      */
  692.     boolean supportsCatalogsInPrivilegeDefinitions() throws SQLException;
  693.  
  694.  
  695.     /**
  696.      * Is positioned DELETE supported?
  697.      *
  698.      * @return true if so
  699.      * @exception SQLException if a database-access error occurs.
  700.      */
  701.     boolean supportsPositionedDelete() throws SQLException;
  702.  
  703.     /**
  704.      * Is positioned UPDATE supported?
  705.      *
  706.      * @return true if so
  707.      * @exception SQLException if a database-access error occurs.
  708.      */
  709.     boolean supportsPositionedUpdate() throws SQLException;
  710.  
  711.     /**
  712.      * Is SELECT for UPDATE supported?
  713.      *
  714.      * @return true if so
  715.      * @exception SQLException if a database-access error occurs.
  716.      */
  717.     boolean supportsSelectForUpdate() throws SQLException;
  718.  
  719.     /**
  720.      * Are stored procedure calls using the stored procedure escape
  721.      * syntax supported?
  722.      *
  723.      * @return true if so 
  724.      * @exception SQLException if a database-access error occurs.
  725.      */
  726.     boolean supportsStoredProcedures() throws SQLException;
  727.  
  728.     /**
  729.      * Are subqueries in comparison expressions supported?
  730.      *
  731.      * A JDBC-Compliant driver always returns true.
  732.      *
  733.      * @return true if so
  734.      * @exception SQLException if a database-access error occurs.
  735.      */
  736.     boolean supportsSubqueriesInComparisons() throws SQLException;
  737.  
  738.     /**
  739.      * Are subqueries in 'exists' expressions supported?
  740.      *
  741.      * A JDBC-Compliant driver always returns true.
  742.      *
  743.      * @return true if so
  744.      * @exception SQLException if a database-access error occurs.
  745.      */
  746.     boolean supportsSubqueriesInExists() throws SQLException;
  747.  
  748.     /**
  749.      * Are subqueries in 'in' statements supported?
  750.      *
  751.      * A JDBC-Compliant driver always returns true.
  752.      *
  753.      * @return true if so
  754.      * @exception SQLException if a database-access error occurs.
  755.      */
  756.     boolean supportsSubqueriesInIns() throws SQLException;
  757.  
  758.     /**
  759.      * Are subqueries in quantified expressions supported?
  760.      *
  761.      * A JDBC-Compliant driver always returns true.
  762.      *
  763.      * @return true if so
  764.      * @exception SQLException if a database-access error occurs.
  765.      */
  766.     boolean supportsSubqueriesInQuantifieds() throws SQLException;
  767.  
  768.     /**
  769.      * Are correlated subqueries supported?
  770.      *
  771.      * A JDBC-Compliant driver always returns true.
  772.      *
  773.      * @return true if so
  774.      * @exception SQLException if a database-access error occurs.
  775.      */
  776.     boolean supportsCorrelatedSubqueries() throws SQLException;
  777.  
  778.     /**
  779.      * Is SQL UNION supported?
  780.      *
  781.      * @return true if so
  782.      * @exception SQLException if a database-access error occurs.
  783.      */
  784.     boolean supportsUnion() throws SQLException;
  785.  
  786.     /**
  787.      * Is SQL UNION ALL supported?
  788.      *
  789.      * @return true if so
  790.      * @exception SQLException if a database-access error occurs.
  791.      */
  792.     boolean supportsUnionAll() throws SQLException;
  793.  
  794.     /**
  795.      * Can cursors remain open across commits? 
  796.      * 
  797.      * @return true if cursors always remain open; false if they might not remain open
  798.      * @exception SQLException if a database-access error occurs.
  799.      */
  800.     boolean supportsOpenCursorsAcrossCommit() throws SQLException;
  801.  
  802.     /**
  803.      * Can cursors remain open across rollbacks?
  804.      * 
  805.      * @return true if cursors always remain open; false if they might not remain open
  806.      * @exception SQLException if a database-access error occurs.
  807.      */
  808.     boolean supportsOpenCursorsAcrossRollback() throws SQLException;
  809.  
  810.     /**
  811.      * Can statements remain open across commits?
  812.      * 
  813.      * @return true if statements always remain open; false if they might not remain open
  814.      * @exception SQLException if a database-access error occurs.
  815.      */
  816.     boolean supportsOpenStatementsAcrossCommit() throws SQLException;
  817.  
  818.     /**
  819.      * Can statements remain open across rollbacks?
  820.      * 
  821.      * @return true if statements always remain open; false if they might not remain open
  822.      * @exception SQLException if a database-access error occurs.
  823.      */
  824.     boolean supportsOpenStatementsAcrossRollback() throws SQLException;
  825.  
  826.     
  827.  
  828.     //----------------------------------------------------------------------
  829.     // The following group of methods exposes various limitations 
  830.     // based on the target database with the current driver.
  831.     // Unless otherwise specified, a result of zero means there is no
  832.     // limit, or the limit is not known.
  833.     
  834.     /**
  835.      * How many hex characters can you have in an inline binary literal?
  836.      *
  837.      * @return max literal length
  838.      * @exception SQLException if a database-access error occurs.
  839.      */
  840.     int getMaxBinaryLiteralLength() throws SQLException;
  841.  
  842.     /**
  843.      * What's the max length for a character literal?
  844.      *
  845.      * @return max literal length
  846.      * @exception SQLException if a database-access error occurs.
  847.      */
  848.     int getMaxCharLiteralLength() throws SQLException;
  849.  
  850.     /**
  851.      * What's the limit on column name length?
  852.      *
  853.      * @return max literal length
  854.      * @exception SQLException if a database-access error occurs.
  855.      */
  856.     int getMaxColumnNameLength() throws SQLException;
  857.  
  858.     /**
  859.      * What's the maximum number of columns in a "GROUP BY" clause?
  860.      *
  861.      * @return max number of columns
  862.      * @exception SQLException if a database-access error occurs.
  863.      */
  864.     int getMaxColumnsInGroupBy() throws SQLException;
  865.  
  866.     /**
  867.      * What's the maximum number of columns allowed in an index?
  868.      *
  869.      * @return max columns
  870.      * @exception SQLException if a database-access error occurs.
  871.      */
  872.     int getMaxColumnsInIndex() throws SQLException;
  873.  
  874.     /**
  875.      * What's the maximum number of columns in an "ORDER BY" clause?
  876.      *
  877.      * @return max columns
  878.      * @exception SQLException if a database-access error occurs.
  879.      */
  880.     int getMaxColumnsInOrderBy() throws SQLException;
  881.  
  882.     /**
  883.      * What's the maximum number of columns in a "SELECT" list?
  884.      *
  885.      * @return max columns
  886.      * @exception SQLException if a database-access error occurs.
  887.      */
  888.     int getMaxColumnsInSelect() throws SQLException;
  889.  
  890.     /**
  891.      * What's the maximum number of columns in a table?
  892.      *
  893.      * @return max columns
  894.      * @exception SQLException if a database-access error occurs.
  895.      */
  896.     int getMaxColumnsInTable() throws SQLException;
  897.  
  898.     /**
  899.      * How many active connections can we have at a time to this database?
  900.      *
  901.      * @return max connections
  902.      * @exception SQLException if a database-access error occurs.
  903.      */
  904.     int getMaxConnections() throws SQLException;
  905.  
  906.     /**
  907.      * What's the maximum cursor name length?
  908.      *
  909.      * @return max cursor name length in bytes
  910.      * @exception SQLException if a database-access error occurs.
  911.      */
  912.     int getMaxCursorNameLength() throws SQLException;
  913.  
  914.     /**
  915.      * What's the maximum length of an index (in bytes)?    
  916.      *
  917.      * @return max index length in bytes
  918.      * @exception SQLException if a database-access error occurs.
  919.      */
  920.     int getMaxIndexLength() throws SQLException;
  921.  
  922.     /**
  923.      * What's the maximum length allowed for a schema name?
  924.      *
  925.      * @return max name length in bytes
  926.      * @exception SQLException if a database-access error occurs.
  927.      */
  928.     int getMaxSchemaNameLength() throws SQLException;
  929.  
  930.     /**
  931.      * What's the maximum length of a procedure name?
  932.      *
  933.      * @return max name length in bytes 
  934.      * @exception SQLException if a database-access error occurs.
  935.      */
  936.     int getMaxProcedureNameLength() throws SQLException;
  937.  
  938.     /**
  939.      * What's the maximum length of a catalog name?
  940.      *
  941.      * @return max name length in bytes
  942.      * @exception SQLException if a database-access error occurs.
  943.      */
  944.     int getMaxCatalogNameLength() throws SQLException;
  945.  
  946.     /**
  947.      * What's the maximum length of a single row?
  948.      *
  949.      * @return max row size in bytes
  950.      * @exception SQLException if a database-access error occurs.
  951.      */
  952.     int getMaxRowSize() throws SQLException;
  953.  
  954.     /**
  955.      * Did getMaxRowSize() include LONGVARCHAR and LONGVARBINARY
  956.      * blobs?
  957.      *
  958.      * @return true if so 
  959.      * @exception SQLException if a database-access error occurs.
  960.      */
  961.     boolean doesMaxRowSizeIncludeBlobs() throws SQLException;
  962.  
  963.     /**
  964.      * What's the maximum length of a SQL statement?
  965.      *
  966.      * @return max length in bytes
  967.      * @exception SQLException if a database-access error occurs.
  968.      */
  969.     int getMaxStatementLength() throws SQLException;
  970.  
  971.     /**
  972.      * How many active statements can we have open at one time to this
  973.      * database?
  974.      *
  975.      * @return the maximum 
  976.      * @exception SQLException if a database-access error occurs.
  977.      */
  978.     int getMaxStatements() throws SQLException;
  979.  
  980.     /**
  981.      * What's the maximum length of a table name?
  982.      *
  983.      * @return max name length in bytes
  984.      * @exception SQLException if a database-access error occurs.
  985.      */
  986.     int getMaxTableNameLength() throws SQLException;
  987.  
  988.     /**
  989.      * What's the maximum number of tables in a SELECT?
  990.      *
  991.      * @return the maximum
  992.      * @exception SQLException if a database-access error occurs.
  993.      */
  994.     int getMaxTablesInSelect() throws SQLException;
  995.  
  996.     /**
  997.      * What's the maximum length of a user name?
  998.      *
  999.      * @return max name length  in bytes
  1000.      * @exception SQLException if a database-access error occurs.
  1001.      */
  1002.     int getMaxUserNameLength() throws SQLException;
  1003.  
  1004.     //----------------------------------------------------------------------
  1005.  
  1006.     /**
  1007.      * What's the database's default transaction isolation level?  The
  1008.      * values are defined in java.sql.Connection.
  1009.      *
  1010.      * @return the default isolation level 
  1011.      * @exception SQLException if a database-access error occurs.
  1012.      * @see Connection
  1013.      */
  1014.     int getDefaultTransactionIsolation() throws SQLException;
  1015.  
  1016.     /**
  1017.      * Are transactions supported? If not, commit is a noop and the
  1018.      * isolation level is TRANSACTION_NONE.
  1019.      *
  1020.      * @return true if transactions are supported 
  1021.      * @exception SQLException if a database-access error occurs.
  1022.      */
  1023.     boolean supportsTransactions() throws SQLException;
  1024.  
  1025.     /**
  1026.      * Does the database support the given transaction isolation level?
  1027.      *
  1028.      * @param level the values are defined in java.sql.Connection
  1029.      * @return true if so 
  1030.      * @exception SQLException if a database-access error occurs.
  1031.      * @see Connection
  1032.      */
  1033.     boolean supportsTransactionIsolationLevel(int level)
  1034.                             throws SQLException;
  1035.  
  1036.     /**
  1037.      * Are both data definition and data manipulation statements
  1038.      * within a transaction supported?
  1039.      *
  1040.      * @return true if so 
  1041.      * @exception SQLException if a database-access error occurs.
  1042.      */
  1043.     boolean supportsDataDefinitionAndDataManipulationTransactions()
  1044.                              throws SQLException;
  1045.     /**
  1046.      * Are only data manipulation statements within a transaction
  1047.      * supported?
  1048.      *
  1049.      * @return true if so
  1050.      * @exception SQLException if a database-access error occurs.
  1051.      */
  1052.     boolean supportsDataManipulationTransactionsOnly()
  1053.                             throws SQLException;
  1054.     /**
  1055.      * Does a data definition statement within a transaction force the
  1056.      * transaction to commit?
  1057.      *
  1058.      * @return true if so 
  1059.      * @exception SQLException if a database-access error occurs.
  1060.      */
  1061.     boolean dataDefinitionCausesTransactionCommit()
  1062.                             throws SQLException;
  1063.     /**
  1064.      * Is a data definition statement within a transaction ignored?
  1065.      *
  1066.      * @return true if so 
  1067.      * @exception SQLException if a database-access error occurs.
  1068.      */
  1069.     boolean dataDefinitionIgnoredInTransactions()
  1070.                             throws SQLException;
  1071.  
  1072.  
  1073.     /**
  1074.      * Get a description of stored procedures available in a
  1075.      * catalog.
  1076.      *
  1077.      * <P>Only procedure descriptions matching the schema and
  1078.      * procedure name criteria are returned.  They are ordered by
  1079.      * PROCEDURE_SCHEM, and PROCEDURE_NAME.
  1080.      *
  1081.      * <P>Each procedure description has the the following columns:
  1082.      *  <OL>
  1083.      *    <LI><B>PROCEDURE_CAT</B> String => procedure catalog (may be null)
  1084.      *    <LI><B>PROCEDURE_SCHEM</B> String => procedure schema (may be null)
  1085.      *    <LI><B>PROCEDURE_NAME</B> String => procedure name
  1086.      *  <LI> reserved for future use
  1087.      *  <LI> reserved for future use
  1088.      *  <LI> reserved for future use
  1089.      *    <LI><B>REMARKS</B> String => explanatory comment on the procedure
  1090.      *    <LI><B>PROCEDURE_TYPE</B> short => kind of procedure:
  1091.      *      <UL>
  1092.      *      <LI> procedureResultUnknown - May return a result
  1093.      *      <LI> procedureNoResult - Does not return a result
  1094.      *      <LI> procedureReturnsResult - Returns a result
  1095.      *      </UL>
  1096.      *  </OL>
  1097.      *
  1098.      * @param catalog a catalog name; "" retrieves those without a
  1099.      * catalog; null means drop catalog name from the selection criteria
  1100.      * @param schemaPattern a schema name pattern; "" retrieves those
  1101.      * without a schema
  1102.      * @param procedureNamePattern a procedure name pattern 
  1103.      * @return ResultSet - each row is a procedure description 
  1104.      * @exception SQLException if a database-access error occurs.
  1105.      * @see #getSearchStringEscape 
  1106.      */
  1107.     ResultSet getProcedures(String catalog, String schemaPattern,
  1108.             String procedureNamePattern) throws SQLException;
  1109.  
  1110.     /**
  1111.      * PROCEDURE_TYPE - May return a result.
  1112.      */
  1113.     int procedureResultUnknown    = 0;
  1114.     /**
  1115.      * PROCEDURE_TYPE - Does not return a result.
  1116.      */
  1117.     int procedureNoResult        = 1;
  1118.     /**
  1119.      * PROCEDURE_TYPE - Returns a result.
  1120.      */
  1121.     int procedureReturnsResult    = 2;
  1122.  
  1123.     /**
  1124.      * Get a description of a catalog's stored procedure parameters
  1125.      * and result columns.
  1126.      *
  1127.      * <P>Only descriptions matching the schema, procedure and
  1128.      * parameter name criteria are returned.  They are ordered by
  1129.      * PROCEDURE_SCHEM and PROCEDURE_NAME. Within this, the return value,
  1130.      * if any, is first. Next are the parameter descriptions in call
  1131.      * order. The column descriptions follow in column number order.
  1132.      *
  1133.      * <P>Each row in the ResultSet is a parameter description or
  1134.      * column description with the following fields:
  1135.      *  <OL>
  1136.      *    <LI><B>PROCEDURE_CAT</B> String => procedure catalog (may be null)
  1137.      *    <LI><B>PROCEDURE_SCHEM</B> String => procedure schema (may be null)
  1138.      *    <LI><B>PROCEDURE_NAME</B> String => procedure name
  1139.      *    <LI><B>COLUMN_NAME</B> String => column/parameter name 
  1140.      *    <LI><B>COLUMN_TYPE</B> Short => kind of column/parameter:
  1141.      *      <UL>
  1142.      *      <LI> procedureColumnUnknown - nobody knows
  1143.      *      <LI> procedureColumnIn - IN parameter
  1144.      *      <LI> procedureColumnInOut - INOUT parameter
  1145.      *      <LI> procedureColumnOut - OUT parameter
  1146.      *      <LI> procedureColumnReturn - procedure return value
  1147.      *      <LI> procedureColumnResult - result column in ResultSet
  1148.      *      </UL>
  1149.      *  <LI><B>DATA_TYPE</B> short => SQL type from java.sql.Types
  1150.      *    <LI><B>TYPE_NAME</B> String => SQL type name
  1151.      *    <LI><B>PRECISION</B> int => precision
  1152.      *    <LI><B>LENGTH</B> int => length in bytes of data
  1153.      *    <LI><B>SCALE</B> short => scale
  1154.      *    <LI><B>RADIX</B> short => radix
  1155.      *    <LI><B>NULLABLE</B> short => can it contain NULL?
  1156.      *      <UL>
  1157.      *      <LI> procedureNoNulls - does not allow NULL values
  1158.      *      <LI> procedureNullable - allows NULL values
  1159.      *      <LI> procedureNullableUnknown - nullability unknown
  1160.      *      </UL>
  1161.      *    <LI><B>REMARKS</B> String => comment describing parameter/column
  1162.      *  </OL>
  1163.      *
  1164.      * <P><B>Note:</B> Some databases may not return the column
  1165.      * descriptions for a procedure. Additional columns beyond
  1166.      * REMARKS can be defined by the database.
  1167.      *
  1168.      * @param catalog a catalog name; "" retrieves those without a
  1169.      * catalog; null means drop catalog name from the selection criteria
  1170.      * @param schemaPattern a schema name pattern; "" retrieves those
  1171.      * without a schema 
  1172.      * @param procedureNamePattern a procedure name pattern 
  1173.      * @param columnNamePattern a column name pattern 
  1174.      * @return ResultSet - each row is a stored procedure parameter or 
  1175.      *      column description 
  1176.      * @exception SQLException if a database-access error occurs.
  1177.      * @see #getSearchStringEscape 
  1178.      */
  1179.     ResultSet getProcedureColumns(String catalog,
  1180.             String schemaPattern,
  1181.             String procedureNamePattern, 
  1182.             String columnNamePattern) throws SQLException;
  1183.  
  1184.     /**
  1185.      * COLUMN_TYPE - nobody knows.
  1186.      */
  1187.     int procedureColumnUnknown = 0;
  1188.  
  1189.     /**
  1190.      * COLUMN_TYPE - IN parameter.
  1191.      */
  1192.     int procedureColumnIn = 1;
  1193.  
  1194.     /**
  1195.      * COLUMN_TYPE - INOUT parameter.
  1196.      */
  1197.     int procedureColumnInOut = 2;
  1198.  
  1199.     /**
  1200.      * COLUMN_TYPE - OUT parameter.
  1201.      */
  1202.     int procedureColumnOut = 4;
  1203.     /**
  1204.      * COLUMN_TYPE - procedure return value.
  1205.      */
  1206.     int procedureColumnReturn = 5;
  1207.  
  1208.     /**
  1209.      * COLUMN_TYPE - result column in ResultSet.
  1210.      */
  1211.     int procedureColumnResult = 3;
  1212.  
  1213.     /**
  1214.      * TYPE NULLABLE - does not allow NULL values.
  1215.      */
  1216.     int procedureNoNulls = 0;
  1217.  
  1218.     /**
  1219.      * TYPE NULLABLE - allows NULL values.
  1220.      */
  1221.     int procedureNullable = 1;
  1222.  
  1223.     /**
  1224.      * TYPE NULLABLE - nullability unknown.
  1225.      */
  1226.     int procedureNullableUnknown = 2;
  1227.  
  1228.  
  1229.     /**
  1230.      * Get a description of tables available in a catalog.
  1231.      *
  1232.      * <P>Only table descriptions matching the catalog, schema, table
  1233.      * name and type criteria are returned.  They are ordered by
  1234.      * TABLE_TYPE, TABLE_SCHEM and TABLE_NAME.
  1235.      *
  1236.      * <P>Each table description has the following columns:
  1237.      *  <OL>
  1238.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1239.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1240.      *    <LI><B>TABLE_NAME</B> String => table name
  1241.      *    <LI><B>TABLE_TYPE</B> String => table type.  Typical types are "TABLE",
  1242.      *            "VIEW",    "SYSTEM TABLE", "GLOBAL TEMPORARY", 
  1243.      *            "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
  1244.      *    <LI><B>REMARKS</B> String => explanatory comment on the table
  1245.      *  </OL>
  1246.      *
  1247.      * <P><B>Note:</B> Some databases may not return information for
  1248.      * all tables.
  1249.      *
  1250.      * @param catalog a catalog name; "" retrieves those without a
  1251.      * catalog; null means drop catalog name from the selection criteria
  1252.      * @param schemaPattern a schema name pattern; "" retrieves those
  1253.      * without a schema
  1254.      * @param tableNamePattern a table name pattern 
  1255.      * @param types a list of table types to include; null returns all types 
  1256.      * @return ResultSet - each row is a table description
  1257.      * @exception SQLException if a database-access error occurs.
  1258.      * @see #getSearchStringEscape 
  1259.      */
  1260.     ResultSet getTables(String catalog, String schemaPattern,
  1261.         String tableNamePattern, String types[]) throws SQLException;
  1262.  
  1263.     /**
  1264.      * Get the schema names available in this database.  The results
  1265.      * are ordered by schema name.
  1266.      *
  1267.      * <P>The schema column is:
  1268.      *  <OL>
  1269.      *    <LI><B>TABLE_SCHEM</B> String => schema name
  1270.      *  </OL>
  1271.      *
  1272.      * @return ResultSet - each row has a single String column that is a
  1273.      * schema name 
  1274.      * @exception SQLException if a database-access error occurs.
  1275.      */
  1276.     ResultSet getSchemas() throws SQLException;
  1277.  
  1278.     /**
  1279.      * Get the catalog names available in this database.  The results
  1280.      * are ordered by catalog name.
  1281.      *
  1282.      * <P>The catalog column is:
  1283.      *  <OL>
  1284.      *    <LI><B>TABLE_CAT</B> String => catalog name
  1285.      *  </OL>
  1286.      *
  1287.      * @return ResultSet - each row has a single String column that is a
  1288.      * catalog name 
  1289.      * @exception SQLException if a database-access error occurs.
  1290.      */
  1291.     ResultSet getCatalogs() throws SQLException;
  1292.  
  1293.     /**
  1294.      * Get the table types available in this database.  The results
  1295.      * are ordered by table type.
  1296.      *
  1297.      * <P>The table type is:
  1298.      *  <OL>
  1299.      *    <LI><B>TABLE_TYPE</B> String => table type.  Typical types are "TABLE",
  1300.      *            "VIEW",    "SYSTEM TABLE", "GLOBAL TEMPORARY", 
  1301.      *            "LOCAL TEMPORARY", "ALIAS", "SYNONYM".
  1302.      *  </OL>
  1303.      *
  1304.      * @return ResultSet - each row has a single String column that is a
  1305.      * table type 
  1306.      * @exception SQLException if a database-access error occurs.
  1307.      */
  1308.     ResultSet getTableTypes() throws SQLException;
  1309.  
  1310.     /**
  1311.      * Get a description of table columns available in a catalog.
  1312.      *
  1313.      * <P>Only column descriptions matching the catalog, schema, table
  1314.      * and column name criteria are returned.  They are ordered by
  1315.      * TABLE_SCHEM, TABLE_NAME and ORDINAL_POSITION.
  1316.      *
  1317.      * <P>Each column description has the following columns:
  1318.      *  <OL>
  1319.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1320.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1321.      *    <LI><B>TABLE_NAME</B> String => table name
  1322.      *    <LI><B>COLUMN_NAME</B> String => column name
  1323.      *    <LI><B>DATA_TYPE</B> short => SQL type from java.sql.Types
  1324.      *    <LI><B>TYPE_NAME</B> String => Data source dependent type name
  1325.      *    <LI><B>COLUMN_SIZE</B> int => column size.  For char or date
  1326.      *        types this is the maximum number of characters, for numeric or
  1327.      *        decimal types this is precision.
  1328.      *    <LI><B>BUFFER_LENGTH</B> is not used.
  1329.      *    <LI><B>DECIMAL_DIGITS</B> int => the number of fractional digits
  1330.      *    <LI><B>NUM_PREC_RADIX</B> int => Radix (typically either 10 or 2)
  1331.      *    <LI><B>NULLABLE</B> int => is NULL allowed?
  1332.      *      <UL>
  1333.      *      <LI> columnNoNulls - might not allow NULL values
  1334.      *      <LI> columnNullable - definitely allows NULL values
  1335.      *      <LI> columnNullableUnknown - nullability unknown
  1336.      *      </UL>
  1337.      *    <LI><B>REMARKS</B> String => comment describing column (may be null)
  1338.      *     <LI><B>COLUMN_DEF</B> String => default value (may be null)
  1339.      *    <LI><B>SQL_DATA_TYPE</B> int => unused
  1340.      *    <LI><B>SQL_DATETIME_SUB</B> int => unused
  1341.      *    <LI><B>CHAR_OCTET_LENGTH</B> int => for char types the 
  1342.      *       maximum number of bytes in the column
  1343.      *    <LI><B>ORDINAL_POSITION</B> int    => index of column in table 
  1344.      *      (starting at 1)
  1345.      *    <LI><B>IS_NULLABLE</B> String => "NO" means column definitely 
  1346.      *      does not allow NULL values; "YES" means the column might 
  1347.      *      allow NULL values.  An empty string means nobody knows.
  1348.      *  </OL>
  1349.      *
  1350.      * @param catalog a catalog name; "" retrieves those without a
  1351.      * catalog; null means drop catalog name from the selection criteria
  1352.      * @param schemaPattern a schema name pattern; "" retrieves those
  1353.      * without a schema
  1354.      * @param tableNamePattern a table name pattern 
  1355.      * @param columnNamePattern a column name pattern 
  1356.      * @return ResultSet - each row is a column description
  1357.      * @exception SQLException if a database-access error occurs.
  1358.      * @see #getSearchStringEscape 
  1359.      */
  1360.     ResultSet getColumns(String catalog, String schemaPattern,
  1361.         String tableNamePattern, String columnNamePattern)
  1362.                     throws SQLException;
  1363.     /**
  1364.      * COLUMN NULLABLE - might not allow NULL values.
  1365.      */
  1366.     int columnNoNulls = 0;
  1367.  
  1368.     /**
  1369.      * COLUMN NULLABLE - definitely allows NULL values.
  1370.      */
  1371.     int columnNullable = 1;
  1372.  
  1373.     /**
  1374.      * COLUMN NULLABLE - nullability unknown.
  1375.      */
  1376.     int columnNullableUnknown = 2;
  1377.  
  1378.     /**
  1379.      * Get a description of the access rights for a table's columns.
  1380.      *
  1381.      * <P>Only privileges matching the column name criteria are
  1382.      * returned.  They are ordered by COLUMN_NAME and PRIVILEGE.
  1383.      *
  1384.      * <P>Each privilige description has the following columns:
  1385.      *  <OL>
  1386.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1387.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1388.      *    <LI><B>TABLE_NAME</B> String => table name
  1389.      *    <LI><B>COLUMN_NAME</B> String => column name
  1390.      *    <LI><B>GRANTOR</B> => grantor of access (may be null)
  1391.      *    <LI><B>GRANTEE</B> String => grantee of access
  1392.      *    <LI><B>PRIVILEGE</B> String => name of access (SELECT, 
  1393.      *      INSERT, UPDATE, REFRENCES, ...)
  1394.      *    <LI><B>IS_GRANTABLE</B> String => "YES" if grantee is permitted 
  1395.      *      to grant to others; "NO" if not; null if unknown 
  1396.      *  </OL>
  1397.      *
  1398.      * @param catalog a catalog name; "" retrieves those without a
  1399.      * catalog; null means drop catalog name from the selection criteria
  1400.      * @param schema a schema name; "" retrieves those without a schema
  1401.      * @param table a table name
  1402.      * @param columnNamePattern a column name pattern 
  1403.      * @return ResultSet - each row is a column privilege description
  1404.      * @exception SQLException if a database-access error occurs.
  1405.      * @see #getSearchStringEscape 
  1406.      */
  1407.     ResultSet getColumnPrivileges(String catalog, String schema,
  1408.         String table, String columnNamePattern) throws SQLException;
  1409.  
  1410.     /**
  1411.      * Get a description of the access rights for each table available
  1412.      * in a catalog. Note that a table privilege applies to one or
  1413.      * more columns in the table. It would be wrong to assume that
  1414.      * this priviledge applies to all columns (this may be true for
  1415.      * some systems but is not true for all.)
  1416.      *
  1417.      * <P>Only privileges matching the schema and table name
  1418.      * criteria are returned.  They are ordered by TABLE_SCHEM,
  1419.      * TABLE_NAME, and PRIVILEGE.
  1420.      *
  1421.      * <P>Each privilige description has the following columns:
  1422.      *  <OL>
  1423.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1424.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1425.      *    <LI><B>TABLE_NAME</B> String => table name
  1426.      *    <LI><B>GRANTOR</B> => grantor of access (may be null)
  1427.      *    <LI><B>GRANTEE</B> String => grantee of access
  1428.      *    <LI><B>PRIVILEGE</B> String => name of access (SELECT, 
  1429.      *      INSERT, UPDATE, REFRENCES, ...)
  1430.      *    <LI><B>IS_GRANTABLE</B> String => "YES" if grantee is permitted 
  1431.      *      to grant to others; "NO" if not; null if unknown 
  1432.      *  </OL>
  1433.      *
  1434.      * @param catalog a catalog name; "" retrieves those without a
  1435.      * catalog; null means drop catalog name from the selection criteria
  1436.      * @param schemaPattern a schema name pattern; "" retrieves those
  1437.      * without a schema
  1438.      * @param tableNamePattern a table name pattern 
  1439.      * @return ResultSet - each row is a table privilege description
  1440.      * @exception SQLException if a database-access error occurs.
  1441.      * @see #getSearchStringEscape 
  1442.      */
  1443.     ResultSet getTablePrivileges(String catalog, String schemaPattern,
  1444.                 String tableNamePattern) throws SQLException;
  1445.  
  1446.     /**
  1447.      * Get a description of a table's optimal set of columns that
  1448.      * uniquely identifies a row. They are ordered by SCOPE.
  1449.      *
  1450.      * <P>Each column description has the following columns:
  1451.      *  <OL>
  1452.      *    <LI><B>SCOPE</B> short => actual scope of result
  1453.      *      <UL>
  1454.      *      <LI> bestRowTemporary - very temporary, while using row
  1455.      *      <LI> bestRowTransaction - valid for remainder of current transaction
  1456.      *      <LI> bestRowSession - valid for remainder of current session
  1457.      *      </UL>
  1458.      *    <LI><B>COLUMN_NAME</B> String => column name
  1459.      *    <LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types
  1460.      *    <LI><B>TYPE_NAME</B> String => Data source dependent type name
  1461.      *    <LI><B>COLUMN_SIZE</B> int => precision
  1462.      *    <LI><B>BUFFER_LENGTH</B> int => not used
  1463.      *    <LI><B>DECIMAL_DIGITS</B> short     => scale
  1464.      *    <LI><B>PSEUDO_COLUMN</B> short => is this a pseudo column 
  1465.      *      like an Oracle ROWID
  1466.      *      <UL>
  1467.      *      <LI> bestRowUnknown - may or may not be pseudo column
  1468.      *      <LI> bestRowNotPseudo - is NOT a pseudo column
  1469.      *      <LI> bestRowPseudo - is a pseudo column
  1470.      *      </UL>
  1471.      *  </OL>
  1472.      *
  1473.      * @param catalog a catalog name; "" retrieves those without a
  1474.      * catalog; null means drop catalog name from the selection criteria
  1475.      * @param schema a schema name; "" retrieves those without a schema
  1476.      * @param table a table name
  1477.      * @param scope the scope of interest; use same values as SCOPE
  1478.      * @param nullable include columns that are nullable?
  1479.      * @return ResultSet - each row is a column description 
  1480.      * @exception SQLException if a database-access error occurs.
  1481.      */
  1482.     ResultSet getBestRowIdentifier(String catalog, String schema,
  1483.         String table, int scope, boolean nullable) throws SQLException;
  1484.     
  1485.     /**
  1486.      * BEST ROW SCOPE - very temporary, while using row.
  1487.      */
  1488.     int bestRowTemporary   = 0;
  1489.  
  1490.     /**
  1491.      * BEST ROW SCOPE - valid for remainder of current transaction.
  1492.      */
  1493.     int bestRowTransaction = 1;
  1494.  
  1495.     /**
  1496.      * BEST ROW SCOPE - valid for remainder of current session.
  1497.      */
  1498.     int bestRowSession     = 2;
  1499.  
  1500.     /**
  1501.      * BEST ROW PSEUDO_COLUMN - may or may not be pseudo column.
  1502.      */
  1503.     int bestRowUnknown    = 0;
  1504.  
  1505.     /**
  1506.      * BEST ROW PSEUDO_COLUMN - is NOT a pseudo column.
  1507.      */
  1508.     int bestRowNotPseudo    = 1;
  1509.  
  1510.     /**
  1511.      * BEST ROW PSEUDO_COLUMN - is a pseudo column.
  1512.      */
  1513.     int bestRowPseudo    = 2;
  1514.  
  1515.     /**
  1516.      * Get a description of a table's columns that are automatically
  1517.      * updated when any value in a row is updated.  They are
  1518.      * unordered.
  1519.      *
  1520.      * <P>Each column description has the following columns:
  1521.      *  <OL>
  1522.      *    <LI><B>SCOPE</B> short => is not used
  1523.      *    <LI><B>COLUMN_NAME</B> String => column name
  1524.      *    <LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types
  1525.      *    <LI><B>TYPE_NAME</B> String => Data source dependent type name
  1526.      *    <LI><B>COLUMN_SIZE</B> int => precision
  1527.      *    <LI><B>BUFFER_LENGTH</B> int => length of column value in bytes
  1528.      *    <LI><B>DECIMAL_DIGITS</B> short     => scale
  1529.      *    <LI><B>PSEUDO_COLUMN</B> short => is this a pseudo column 
  1530.      *      like an Oracle ROWID
  1531.      *      <UL>
  1532.      *      <LI> versionColumnUnknown - may or may not be pseudo column
  1533.      *      <LI> versionColumnNotPseudo - is NOT a pseudo column
  1534.      *      <LI> versionColumnPseudo - is a pseudo column
  1535.      *      </UL>
  1536.      *  </OL>
  1537.      *
  1538.      * @param catalog a catalog name; "" retrieves those without a
  1539.      * catalog; null means drop catalog name from the selection criteria
  1540.      * @param schema a schema name; "" retrieves those without a schema
  1541.      * @param table a table name
  1542.      * @return ResultSet - each row is a column description 
  1543.      * @exception SQLException if a database-access error occurs.
  1544.      */
  1545.     ResultSet getVersionColumns(String catalog, String schema,
  1546.                 String table) throws SQLException;
  1547.     
  1548.     /**
  1549.      * VERSION COLUMNS PSEUDO_COLUMN - may or may not be pseudo column.
  1550.      */
  1551.     int versionColumnUnknown    = 0;
  1552.  
  1553.     /**
  1554.      *  VERSION COLUMNS PSEUDO_COLUMN - is NOT a pseudo column.
  1555.      */
  1556.     int versionColumnNotPseudo    = 1;
  1557.  
  1558.     /**
  1559.      *  VERSION COLUMNS PSEUDO_COLUMN - is a pseudo column.
  1560.      */
  1561.     int versionColumnPseudo    = 2;
  1562.  
  1563.     /**
  1564.      * Get a description of a table's primary key columns.  They
  1565.      * are ordered by COLUMN_NAME.
  1566.      *
  1567.      * <P>Each primary key column description has the following columns:
  1568.      *  <OL>
  1569.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1570.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1571.      *    <LI><B>TABLE_NAME</B> String => table name
  1572.      *    <LI><B>COLUMN_NAME</B> String => column name
  1573.      *    <LI><B>KEY_SEQ</B> short => sequence number within primary key
  1574.      *    <LI><B>PK_NAME</B> String => primary key name (may be null)
  1575.      *  </OL>
  1576.      *
  1577.      * @param catalog a catalog name; "" retrieves those without a
  1578.      * catalog; null means drop catalog name from the selection criteria
  1579.      * @param schema a schema name pattern; "" retrieves those
  1580.      * without a schema
  1581.      * @param table a table name
  1582.      * @return ResultSet - each row is a primary key column description 
  1583.      * @exception SQLException if a database-access error occurs.
  1584.      */
  1585.     ResultSet getPrimaryKeys(String catalog, String schema,
  1586.                 String table) throws SQLException;
  1587.  
  1588.     /**
  1589.      * Get a description of the primary key columns that are
  1590.      * referenced by a table's foreign key columns (the primary keys
  1591.      * imported by a table).  They are ordered by PKTABLE_CAT,
  1592.      * PKTABLE_SCHEM, PKTABLE_NAME, and KEY_SEQ.
  1593.      *
  1594.      * <P>Each primary key column description has the following columns:
  1595.      *  <OL>
  1596.      *    <LI><B>PKTABLE_CAT</B> String => primary key table catalog 
  1597.      *      being imported (may be null)
  1598.      *    <LI><B>PKTABLE_SCHEM</B> String => primary key table schema
  1599.      *      being imported (may be null)
  1600.      *    <LI><B>PKTABLE_NAME</B> String => primary key table name
  1601.      *      being imported
  1602.      *    <LI><B>PKCOLUMN_NAME</B> String => primary key column name
  1603.      *      being imported
  1604.      *    <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null)
  1605.      *    <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null)
  1606.      *    <LI><B>FKTABLE_NAME</B> String => foreign key table name
  1607.      *    <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
  1608.      *    <LI><B>KEY_SEQ</B> short => sequence number within foreign key
  1609.      *    <LI><B>UPDATE_RULE</B> short => What happens to 
  1610.      *       foreign key when primary is updated:
  1611.      *      <UL>
  1612.      *      <LI> importedNoAction - do not allow update of primary 
  1613.      *               key if it has been imported
  1614.      *      <LI> importedKeyCascade - change imported key to agree 
  1615.      *               with primary key update
  1616.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1617.      *               its primary key has been updated
  1618.      *      <LI> importedKeySetDefault - change imported key to default values 
  1619.      *               if its primary key has been updated
  1620.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1621.      *                                 (for ODBC 2.x compatibility)
  1622.      *      </UL>
  1623.      *    <LI><B>DELETE_RULE</B> short => What happens to 
  1624.      *      the foreign key when primary is deleted.
  1625.      *      <UL>
  1626.      *      <LI> importedKeyNoAction - do not allow delete of primary 
  1627.      *               key if it has been imported
  1628.      *      <LI> importedKeyCascade - delete rows that import a deleted key
  1629.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1630.      *               its primary key has been deleted
  1631.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1632.      *                                 (for ODBC 2.x compatibility)
  1633.      *      <LI> importedKeySetDefault - change imported key to default if 
  1634.      *               its primary key has been deleted
  1635.      *      </UL>
  1636.      *    <LI><B>FK_NAME</B> String => foreign key name (may be null)
  1637.      *    <LI><B>PK_NAME</B> String => primary key name (may be null)
  1638.      *    <LI><B>DEFERRABILITY</B> short => can the evaluation of foreign key 
  1639.      *      constraints be deferred until commit
  1640.      *      <UL>
  1641.      *      <LI> importedKeyInitiallyDeferred - see SQL92 for definition
  1642.      *      <LI> importedKeyInitiallyImmediate - see SQL92 for definition 
  1643.      *      <LI> importedKeyNotDeferrable - see SQL92 for definition 
  1644.      *      </UL>
  1645.      *  </OL>
  1646.      *
  1647.      * @param catalog a catalog name; "" retrieves those without a
  1648.      * catalog; null means drop catalog name from the selection criteria
  1649.      * @param schema a schema name pattern; "" retrieves those
  1650.      * without a schema
  1651.      * @param table a table name
  1652.      * @return ResultSet - each row is a primary key column description 
  1653.      * @exception SQLException if a database-access error occurs.
  1654.      * @see #getExportedKeys 
  1655.      */
  1656.     ResultSet getImportedKeys(String catalog, String schema,
  1657.                 String table) throws SQLException;
  1658.  
  1659.     /**
  1660.      * IMPORT KEY UPDATE_RULE and DELETE_RULE - for update, change
  1661.      * imported key to agree with primary key update; for delete,
  1662.      * delete rows that import a deleted key.
  1663.      */
  1664.     int importedKeyCascade    = 0;
  1665.  
  1666.     /**
  1667.      * IMPORT KEY UPDATE_RULE and DELETE_RULE - do not allow update or
  1668.      * delete of primary key if it has been imported.  
  1669.      */
  1670.     int importedKeyRestrict = 1;
  1671.  
  1672.     /**
  1673.      * IMPORT KEY UPDATE_RULE and DELETE_RULE - change imported key to
  1674.      * NULL if its primary key has been updated or deleted.
  1675.      */
  1676.     int importedKeySetNull  = 2;
  1677.  
  1678.     /**
  1679.      * IMPORT KEY UPDATE_RULE and DELETE_RULE - do not allow update or
  1680.      * delete of primary key if it has been imported.  
  1681.      */
  1682.     int importedKeyNoAction = 3;
  1683.  
  1684.     /**
  1685.      * IMPORT KEY UPDATE_RULE and DELETE_RULE - change imported key to
  1686.      * default values if its primary key has been updated or deleted.
  1687.      */
  1688.     int importedKeySetDefault  = 4;
  1689.  
  1690.     /**
  1691.      * IMPORT KEY DEFERRABILITY - see SQL92 for definition
  1692.      */
  1693.     int importedKeyInitiallyDeferred  = 5;
  1694.  
  1695.     /**
  1696.      * IMPORT KEY DEFERRABILITY - see SQL92 for definition
  1697.      */
  1698.     int importedKeyInitiallyImmediate  = 6;
  1699.  
  1700.     /**
  1701.      * IMPORT KEY DEFERRABILITY - see SQL92 for definition
  1702.      */
  1703.     int importedKeyNotDeferrable  = 7;
  1704.  
  1705.     /**
  1706.      * Get a description of the foreign key columns that reference a
  1707.      * table's primary key columns (the foreign keys exported by a
  1708.      * table).  They are ordered by FKTABLE_CAT, FKTABLE_SCHEM,
  1709.      * FKTABLE_NAME, and KEY_SEQ.
  1710.      *
  1711.      * <P>Each foreign key column description has the following columns:
  1712.      *  <OL>
  1713.      *    <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be null)
  1714.      *    <LI><B>PKTABLE_SCHEM</B> String => primary key table schema (may be null)
  1715.      *    <LI><B>PKTABLE_NAME</B> String => primary key table name
  1716.      *    <LI><B>PKCOLUMN_NAME</B> String => primary key column name
  1717.      *    <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null)
  1718.      *      being exported (may be null)
  1719.      *    <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null)
  1720.      *      being exported (may be null)
  1721.      *    <LI><B>FKTABLE_NAME</B> String => foreign key table name
  1722.      *      being exported
  1723.      *    <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
  1724.      *      being exported
  1725.      *    <LI><B>KEY_SEQ</B> short => sequence number within foreign key
  1726.      *    <LI><B>UPDATE_RULE</B> short => What happens to 
  1727.      *       foreign key when primary is updated:
  1728.      *      <UL>
  1729.      *      <LI> importedNoAction - do not allow update of primary 
  1730.      *               key if it has been imported
  1731.      *      <LI> importedKeyCascade - change imported key to agree 
  1732.      *               with primary key update
  1733.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1734.      *               its primary key has been updated
  1735.      *      <LI> importedKeySetDefault - change imported key to default values 
  1736.      *               if its primary key has been updated
  1737.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1738.      *                                 (for ODBC 2.x compatibility)
  1739.      *      </UL>
  1740.      *    <LI><B>DELETE_RULE</B> short => What happens to 
  1741.      *      the foreign key when primary is deleted.
  1742.      *      <UL>
  1743.      *      <LI> importedKeyNoAction - do not allow delete of primary 
  1744.      *               key if it has been imported
  1745.      *      <LI> importedKeyCascade - delete rows that import a deleted key
  1746.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1747.      *               its primary key has been deleted
  1748.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1749.      *                                 (for ODBC 2.x compatibility)
  1750.      *      <LI> importedKeySetDefault - change imported key to default if 
  1751.      *               its primary key has been deleted
  1752.      *      </UL>
  1753.      *    <LI><B>FK_NAME</B> String => foreign key name (may be null)
  1754.      *    <LI><B>PK_NAME</B> String => primary key name (may be null)
  1755.      *    <LI><B>DEFERRABILITY</B> short => can the evaluation of foreign key 
  1756.      *      constraints be deferred until commit
  1757.      *      <UL>
  1758.      *      <LI> importedKeyInitiallyDeferred - see SQL92 for definition
  1759.      *      <LI> importedKeyInitiallyImmediate - see SQL92 for definition 
  1760.      *      <LI> importedKeyNotDeferrable - see SQL92 for definition 
  1761.      *      </UL>
  1762.      *  </OL>
  1763.      *
  1764.      * @param catalog a catalog name; "" retrieves those without a
  1765.      * catalog; null means drop catalog name from the selection criteria
  1766.      * @param schema a schema name pattern; "" retrieves those
  1767.      * without a schema
  1768.      * @param table a table name
  1769.      * @return ResultSet - each row is a foreign key column description 
  1770.      * @exception SQLException if a database-access error occurs.
  1771.      * @see #getImportedKeys 
  1772.      */
  1773.     ResultSet getExportedKeys(String catalog, String schema,
  1774.                 String table) throws SQLException;
  1775.  
  1776.     /**
  1777.      * Get a description of the foreign key columns in the foreign key
  1778.      * table that reference the primary key columns of the primary key
  1779.      * table (describe how one table imports another's key.) This
  1780.      * should normally return a single foreign key/primary key pair
  1781.      * (most tables only import a foreign key from a table once.)  They
  1782.      * are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and
  1783.      * KEY_SEQ.
  1784.      *
  1785.      * <P>Each foreign key column description has the following columns:
  1786.      *  <OL>
  1787.      *    <LI><B>PKTABLE_CAT</B> String => primary key table catalog (may be null)
  1788.      *    <LI><B>PKTABLE_SCHEM</B> String => primary key table schema (may be null)
  1789.      *    <LI><B>PKTABLE_NAME</B> String => primary key table name
  1790.      *    <LI><B>PKCOLUMN_NAME</B> String => primary key column name
  1791.      *    <LI><B>FKTABLE_CAT</B> String => foreign key table catalog (may be null)
  1792.      *      being exported (may be null)
  1793.      *    <LI><B>FKTABLE_SCHEM</B> String => foreign key table schema (may be null)
  1794.      *      being exported (may be null)
  1795.      *    <LI><B>FKTABLE_NAME</B> String => foreign key table name
  1796.      *      being exported
  1797.      *    <LI><B>FKCOLUMN_NAME</B> String => foreign key column name
  1798.      *      being exported
  1799.      *    <LI><B>KEY_SEQ</B> short => sequence number within foreign key
  1800.      *    <LI><B>UPDATE_RULE</B> short => What happens to 
  1801.      *       foreign key when primary is updated:
  1802.      *      <UL>
  1803.      *      <LI> importedNoAction - do not allow update of primary 
  1804.      *               key if it has been imported
  1805.      *      <LI> importedKeyCascade - change imported key to agree 
  1806.      *               with primary key update
  1807.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1808.      *               its primary key has been updated
  1809.      *      <LI> importedKeySetDefault - change imported key to default values 
  1810.      *               if its primary key has been updated
  1811.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1812.      *                                 (for ODBC 2.x compatibility)
  1813.      *      </UL>
  1814.      *    <LI><B>DELETE_RULE</B> short => What happens to 
  1815.      *      the foreign key when primary is deleted.
  1816.      *      <UL>
  1817.      *      <LI> importedKeyNoAction - do not allow delete of primary 
  1818.      *               key if it has been imported
  1819.      *      <LI> importedKeyCascade - delete rows that import a deleted key
  1820.      *      <LI> importedKeySetNull - change imported key to NULL if 
  1821.      *               its primary key has been deleted
  1822.      *      <LI> importedKeyRestrict - same as importedKeyNoAction 
  1823.      *                                 (for ODBC 2.x compatibility)
  1824.      *      <LI> importedKeySetDefault - change imported key to default if 
  1825.      *               its primary key has been deleted
  1826.      *      </UL>
  1827.      *    <LI><B>FK_NAME</B> String => foreign key name (may be null)
  1828.      *    <LI><B>PK_NAME</B> String => primary key name (may be null)
  1829.      *    <LI><B>DEFERRABILITY</B> short => can the evaluation of foreign key 
  1830.      *      constraints be deferred until commit
  1831.      *      <UL>
  1832.      *      <LI> importedKeyInitiallyDeferred - see SQL92 for definition
  1833.      *      <LI> importedKeyInitiallyImmediate - see SQL92 for definition 
  1834.      *      <LI> importedKeyNotDeferrable - see SQL92 for definition 
  1835.      *      </UL>
  1836.      *  </OL>
  1837.      *
  1838.      * @param primaryCatalog a catalog name; "" retrieves those without a
  1839.      * catalog; null means drop catalog name from the selection criteria
  1840.      * @param primarySchema a schema name pattern; "" retrieves those
  1841.      * without a schema
  1842.      * @param primaryTable the table name that exports the key
  1843.      * @param foreignCatalog a catalog name; "" retrieves those without a
  1844.      * catalog; null means drop catalog name from the selection criteria
  1845.      * @param foreignSchema a schema name pattern; "" retrieves those
  1846.      * without a schema
  1847.      * @param foreignTable the table name that imports the key
  1848.      * @return ResultSet - each row is a foreign key column description 
  1849.      * @exception SQLException if a database-access error occurs.
  1850.      * @see #getImportedKeys 
  1851.      */
  1852.     ResultSet getCrossReference(
  1853.         String primaryCatalog, String primarySchema, String primaryTable,
  1854.         String foreignCatalog, String foreignSchema, String foreignTable
  1855.         ) throws SQLException;
  1856.  
  1857.     /**
  1858.      * Get a description of all the standard SQL types supported by
  1859.      * this database. They are ordered by DATA_TYPE and then by how
  1860.      * closely the data type maps to the corresponding JDBC SQL type.
  1861.      *
  1862.      * <P>Each type description has the following columns:
  1863.      *  <OL>
  1864.      *    <LI><B>TYPE_NAME</B> String => Type name
  1865.      *    <LI><B>DATA_TYPE</B> short => SQL data type from java.sql.Types
  1866.      *    <LI><B>PRECISION</B> int => maximum precision
  1867.      *    <LI><B>LITERAL_PREFIX</B> String => prefix used to quote a literal 
  1868.      *      (may be null)
  1869.      *    <LI><B>LITERAL_SUFFIX</B> String => suffix used to quote a literal 
  1870.             (may be null)
  1871.      *    <LI><B>CREATE_PARAMS</B> String => parameters used in creating 
  1872.      *      the type (may be null)
  1873.      *    <LI><B>NULLABLE</B> short => can you use NULL for this type?
  1874.      *      <UL>
  1875.      *      <LI> typeNoNulls - does not allow NULL values
  1876.      *      <LI> typeNullable - allows NULL values
  1877.      *      <LI> typeNullableUnknown - nullability unknown
  1878.      *      </UL>
  1879.      *    <LI><B>CASE_SENSITIVE</B> boolean=> is it case sensitive?
  1880.      *    <LI><B>SEARCHABLE</B> short => can you use "WHERE" based on this type:
  1881.      *      <UL>
  1882.      *      <LI> typePredNone - No support
  1883.      *      <LI> typePredChar - Only supported with WHERE .. LIKE
  1884.      *      <LI> typePredBasic - Supported except for WHERE .. LIKE
  1885.      *      <LI> typeSearchable - Supported for all WHERE ..
  1886.      *      </UL>
  1887.      *    <LI><B>UNSIGNED_ATTRIBUTE</B> boolean => is it unsigned?
  1888.      *    <LI><B>FIXED_PREC_SCALE</B> boolean => can it be a money value?
  1889.      *    <LI><B>AUTO_INCREMENT</B> boolean => can it be used for an 
  1890.      *      auto-increment value?
  1891.      *    <LI><B>LOCAL_TYPE_NAME</B> String => localized version of type name 
  1892.      *      (may be null)
  1893.      *    <LI><B>MINIMUM_SCALE</B> short => minimum scale supported
  1894.      *    <LI><B>MAXIMUM_SCALE</B> short => maximum scale supported
  1895.      *    <LI><B>SQL_DATA_TYPE</B> int => unused
  1896.      *    <LI><B>SQL_DATETIME_SUB</B> int => unused
  1897.      *    <LI><B>NUM_PREC_RADIX</B> int => usually 2 or 10
  1898.      *  </OL>
  1899.      *
  1900.      * @return ResultSet - each row is a SQL type description 
  1901.      * @exception SQLException if a database-access error occurs.
  1902.      */
  1903.     ResultSet getTypeInfo() throws SQLException;
  1904.     
  1905.     /**
  1906.      * TYPE NULLABLE - does not allow NULL values.
  1907.      */
  1908.     int typeNoNulls = 0;
  1909.  
  1910.     /**
  1911.      * TYPE NULLABLE - allows NULL values.
  1912.      */
  1913.     int typeNullable = 1;
  1914.  
  1915.     /**
  1916.      * TYPE NULLABLE - nullability unknown.
  1917.      */
  1918.     int typeNullableUnknown = 2;
  1919.  
  1920.     /**
  1921.      * TYPE INFO SEARCHABLE - No support.
  1922.      */
  1923.     int typePredNone = 0;
  1924.  
  1925.     /**
  1926.      * TYPE INFO SEARCHABLE - Only supported with WHERE .. LIKE.
  1927.      */
  1928.     int typePredChar = 1;
  1929.  
  1930.     /**
  1931.      * TYPE INFO SEARCHABLE -  Supported except for WHERE .. LIKE.
  1932.      */
  1933.     int typePredBasic = 2;
  1934.  
  1935.     /**
  1936.      * TYPE INFO SEARCHABLE - Supported for all WHERE ...
  1937.      */
  1938.     int typeSearchable  = 3;
  1939.  
  1940.     /**
  1941.      * Get a description of a table's indices and statistics. They are
  1942.      * ordered by NON_UNIQUE, TYPE, INDEX_NAME, and ORDINAL_POSITION.
  1943.      *
  1944.      * <P>Each index column description has the following columns:
  1945.      *  <OL>
  1946.      *    <LI><B>TABLE_CAT</B> String => table catalog (may be null)
  1947.      *    <LI><B>TABLE_SCHEM</B> String => table schema (may be null)
  1948.      *    <LI><B>TABLE_NAME</B> String => table name
  1949.      *    <LI><B>NON_UNIQUE</B> boolean => Can index values be non-unique? 
  1950.      *      false when TYPE is tableIndexStatistic
  1951.      *    <LI><B>INDEX_QUALIFIER</B> String => index catalog (may be null); 
  1952.      *      null when TYPE is tableIndexStatistic
  1953.      *    <LI><B>INDEX_NAME</B> String => index name; null when TYPE is 
  1954.      *      tableIndexStatistic
  1955.      *    <LI><B>TYPE</B> short => index type:
  1956.      *      <UL>
  1957.      *      <LI> tableIndexStatistic - this identifies table statistics that are
  1958.      *           returned in conjuction with a table's index descriptions
  1959.      *      <LI> tableIndexClustered - this is a clustered index
  1960.      *      <LI> tableIndexHashed - this is a hashed index
  1961.      *      <LI> tableIndexOther - this is some other style of index
  1962.      *      </UL>
  1963.      *    <LI><B>ORDINAL_POSITION</B> short => column sequence number 
  1964.      *      within index; zero when TYPE is tableIndexStatistic
  1965.      *    <LI><B>COLUMN_NAME</B> String => column name; null when TYPE is 
  1966.      *      tableIndexStatistic
  1967.      *    <LI><B>ASC_OR_DESC</B> String => column sort sequence, "A" => ascending, 
  1968.      *      "D" => descending, may be null if sort sequence is not supported; 
  1969.      *      null when TYPE is tableIndexStatistic    
  1970.      *    <LI><B>CARDINALITY</B> int => When TYPE is tableIndexStatistic, then 
  1971.      *      this is the number of rows in the table; otherwise, it is the 
  1972.      *      number of unique values in the index.
  1973.      *    <LI><B>PAGES</B> int => When TYPE is  tableIndexStatisic then 
  1974.      *      this is the number of pages used for the table, otherwise it 
  1975.      *      is the number of pages used for the current index.
  1976.      *    <LI><B>FILTER_CONDITION</B> String => Filter condition, if any.  
  1977.      *      (may be null)
  1978.      *  </OL>
  1979.      *
  1980.      * @param catalog a catalog name; "" retrieves those without a
  1981.      * catalog; null means drop catalog name from the selection criteria
  1982.      * @param schema a schema name pattern; "" retrieves those without a schema
  1983.      * @param table a table name  
  1984.      * @param unique when true, return only indices for unique values; 
  1985.      *     when false, return indices regardless of whether unique or not 
  1986.      * @param approximate when true, result is allowed to reflect approximate 
  1987.      *     or out of data values; when false, results are requested to be 
  1988.      *     accurate
  1989.      * @return ResultSet - each row is an index column description 
  1990.      * @exception SQLException if a database-access error occurs.
  1991.      */
  1992.     ResultSet getIndexInfo(String catalog, String schema, String table,
  1993.             boolean unique, boolean approximate)
  1994.                     throws SQLException;
  1995.  
  1996.     /**
  1997.      * INDEX INFO TYPE - this identifies table statistics that are
  1998.      * returned in conjuction with a table's index descriptions
  1999.      */
  2000.     short tableIndexStatistic = 0;
  2001.  
  2002.     /**
  2003.      * INDEX INFO TYPE - this identifies a clustered index
  2004.      */
  2005.     short tableIndexClustered = 1;
  2006.  
  2007.     /**
  2008.      * INDEX INFO TYPE - this identifies a hashed index
  2009.      */
  2010.     short tableIndexHashed    = 2;
  2011.  
  2012.     /**
  2013.      * INDEX INFO TYPE - this identifies some other form of index
  2014.      */
  2015.     short tableIndexOther     = 3;
  2016.  }
  2017.  
  2018.